package com.ljf.daily.makemoneydetail.web;

import com.ljf.common.exception.ServiceException;
import com.ljf.common.result.ResultModel;
import com.ljf.common.web.BasisController;
import com.ljf.daily.makemoneydetail.dto.command.DailyDatMakeMoneyDetailAccountAdjustCommand;
import com.ljf.daily.makemoneydetail.dto.command.DailyDatMakeMoneyDetailCommand;
import com.ljf.daily.makemoneydetail.dto.command.DailyDatMakeMoneyDetailImportDataCommand;
import com.ljf.daily.makemoneydetail.dto.command.DailyDatMakeMoneyDetailTemplateImportCommand;
import com.ljf.daily.makemoneydetail.dto.query.DailyDatMakeMoneyDetailQuery;
import com.ljf.daily.makemoneydetail.service.IDailyDatMakeMoneyDetailService;
import com.ljf.daily.makemoneydetail.vo.DailyDatMakeMoneyDetailVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 赚钱明细记录  控制器
 *
 * @author LJF
 * @since 2024-01-22
 */
@RestController
@RequestMapping("/daily/dat/make_money_detail")
@Api(value = "赚钱明细记录接口", tags = "赚钱明细记录接口")
public class DailyDatMakeMoneyDetailController extends BasisController<IDailyDatMakeMoneyDetailService, DailyDatMakeMoneyDetailQuery, DailyDatMakeMoneyDetailVO, DailyDatMakeMoneyDetailCommand> {

    @PostMapping("/import_data")
    @ApiOperation(value = "导入数据接口")
    public ResultModel importData(@RequestBody DailyDatMakeMoneyDetailImportDataCommand command) throws ServiceException {
        return service.importData(command);
    }

    @PostMapping("/account_adjust")
    @ApiOperation(value = "账户调整接口")
    public ResultModel accountAdjust(@RequestBody @Validated DailyDatMakeMoneyDetailAccountAdjustCommand command) throws ServiceException {
        return service.accountAdjust(command);
    }

    @PostMapping("/template_import")
    @ApiOperation(value = "模板导入接口")
    public ResultModel templateImport(@RequestBody @Validated DailyDatMakeMoneyDetailTemplateImportCommand command) throws ServiceException {
        return service.templateImport(command);
    }

}